// phalanx is_move_reference.hpp.cu header file

// Copyright (c) 2010 - 2011 Kohei Takahashi (Flast).
// Distributed under the MIT license. for more detail see COPYING.

#ifndef IG_PHALANX_MOVE_DETAIL_IS_MOVE_REFERENCE_HPP_CU_ONCE_
#define IG_PHALANX_MOVE_DETAIL_IS_MOVE_REFERENCE_HPP_CU_ONCE_

#include <phalanx/config.hpp.cu>

#include <boost/mpl/and.hpp>

#include <phalanx/move/detail/rvalue.hpp.cu>

#include <phalanx/type_traits/integral_constant.hpp.cu>
#include <phalanx/type_traits/is_lvalue_reference.hpp.cu>
#include <phalanx/type_traits/remove_cv.hpp.cu>
#include <phalanx/type_traits/remove_reference.hpp.cu>

namespace phalanx
{

namespace move_detail
{

template < typename >
struct is_rv_
  : public false_type {};

template < typename T >
struct is_rv_< rv_< T > >
  : public true_type {};

template < typename T >
struct is_move_reference
  : public ::boost::mpl::and_<
      is_rv_< typename remove_cv<
        typename remove_reference< T >::type >::type >,
      is_lvalue_reference< T > > {};

} // namespace move_detail

} // namespace phalanx

#endif // IG_PHALANX_MOVE_DETAIL_IS_MOVE_REFERENCE_HPP_CU_ONCE_

